package fr.univ.surveyonline.dispatcher;

import java.io.IOException;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class ChangeLanguageServlet extends HttpServlet {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
		
		String language = req.getParameter("lg");
		if (language != null) {
			Cookie c = new Cookie("langue",language);
			resp.addCookie(c);
			resp.sendRedirect("/");
		}
	}
}
